﻿using System;
using System.Collections.Generic;
using System.Text;

namespace CSharp
{
    //按成绩给学生确定级别
    public class Score
    {
        private double _score;
        public Score(double score)
        {
            _score = score;
        }
        public ScoreGrade Transfor()
        {
            //throw new NotImplementedException();
            if (_score < 0 || _score > 100)
            {
                throw new ArgumentOutOfRangeException($"输入的{_score}值超出范围");
            }
            else if (_score > 80)
            {
                return ScoreGrade.excellent;
            }
            else if (_score > 60)
            {
                return ScoreGrade.passed;
            }
            else
            {
                return ScoreGrade.faild;
            }
        }
    }
    public enum ScoreGrade
    {
        excellent,
        passed,
        faild
    };
}
